<%@ page language="java" contentType="text/html; charset=utf-8" 
    pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>index.jsp</title>
<style type="text/css">
	.f_left{
		float:left;
	}
	.clear{
		clear:both;
	}
	body {
		font-size:12px;
	}
	form div{
		line-height: 25px;
	}
}
</style>
</head>
<body>
	<form action="${pageContext.request.contextPath}/bindData/test3" method="post">
		<div class="f_left">会员1号:</div>
		<div class="f_left">
		<input name="users[0].name" value="张三"/>
		</div>
		<div class="clear"></div>
		<div class="f_left">会员2号:</div>
		<div class="f_left">
		<input name="users[1].name" value="李四"/>
		</div>
		<div class="clear"></div>
		<div class="f_left">会员3号:</div>
		<div class="f_left">
		<input name="users[2].name" value="王五"/>
		</div>
		<div class="clear"></div>
		<div><input type="submit" value="提交表单"/></div>
	</form>
	<br>
	<hr>
	<h1>网络传递参数</h1>
	<h3>
	users[0].name:"张三",users[1].name:"李四",users[2].name:"王五"
	</h3>
	<h1>后台代码</h1>
	<h4>
		<pre>
	@RequestMapping("/test3")
	public void test3(Club club)
	{
		System.out.println("list类型绑定=========");
		System.out.println("会员:");
		for (User user : club.getUsers())
		{
			System.out.println(user.getName());
		}
		System.out.println("========================");
	}
		</pre>
		<br><hr/>
		<pre>
		<code>
		public class Club {
			private List<User> users = new ArrayList<User>();
			
			public List<User> getUsers() {
				return users;
			}
			
			public void setUsers(List<User> users) {
				this.users = users;
			}
		}
		</code>
	</pre>
	</h4>
	<h1>打印输出</h1>
	<h3>
	<pre>
	list类型绑定=========
		会员:
		张三
		李四
		王五
	</pre>
	
	</h3>
	
	
</body>
</html>